<?php   
class ControllerCommonHeader extends Controller {
	protected function index() {
		$this->data['title'] = $this->document->getTitle();
		
		if (isset($this->request->server['HTTPS']) && (($this->request->server['HTTPS'] == 'on') || ($this->request->server['HTTPS'] == '1'))) {
			$this->data['base'] = $this->config->get('config_ssl');
		} else {
			$this->data['base'] = $this->config->get('config_url');
		}
		
		$this->data['description'] = $this->document->getDescription();
		$this->data['keywords'] = $this->document->getKeywords();
		$this->data['links'] = $this->document->getLinks();	 
		$this->data['styles'] = $this->document->getStyles();
		$this->data['scripts'] = $this->document->getScripts();
		$this->data['google_analytics'] = html_entity_decode($this->config->get('config_google_analytics'), ENT_QUOTES, 'UTF-8');
    
        $this->data['home'] = 'index.php';
        $this->data['site_list'] = $this->url->link('site/list', '', 'SSL');
        $this->data['site_manger'] = $this->url->link('site/manger', '', 'SSL');
        $this->data['category_manger'] = $this->url->link('category/manger', '', 'SSL');
        $this->data['category_list'] = $this->url->link('category/list', '', 'SSL');
		
		if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/common/header.tpl')) {
			$this->template = $this->config->get('config_template') . '/common/header.tpl';
		} else {
			$this->template = 'common/header.tpl';
		}
		
    	$this->render();
	} 	
}
?>